<template>
  <van-tabbar route>
    <van-tabbar-item icon="home-o" to="/list0">首页</van-tabbar-item>
    <van-tabbar-item icon="shopping-cart-o" to="/order" :badge="num">购物车</van-tabbar-item>
    <van-tabbar-item icon="friends-o"   @click="to_own_or_register">个人</van-tabbar-item>
  </van-tabbar>
</template>

<script>
export default {
  data() {
    return {};
  },
  methods: {
    to_own_or_register(){
      if (!localStorage.getItem("user")) {
        
        this.$router.push('/login')
     
      }else{

        this.$router.push('/own')
      }

    }
  },
  computed: {
    num() {
      return this.$store.state.order_all.length
    }
  },
};
</script>

<style >
</style>